package entity;

import java.util.Scanner;

public class WeightApp {
	
	private Scanner scan;
	
	public WeightApp(Scanner scan){
		this.scan = scan;
	}

	public void run() {
		System.out.println("****************************");
		System.out.println("WeightApp vrs. 0.1");
		System.out.println("****************************");
		System.out.println("Indtast tara vægt i kg: ");
		try {
			double tara = 0;
			tara = scan.nextDouble();
			System.out.println("Indtast brutto vægt i kg: ");
			double brutto = 0;
			brutto = scan.nextDouble();
			System.out.println("****************************");
			double netto = brutto - tara;
			System.out.println("Netto vægt: " + netto);
			System.out.println("****************************");
		} catch (Exception e) {
			System.out.println("Input ikke godkendt");
		}
		System.out.println("WeightApp afsluttes.");
	}
}
